public partial class Schedule : Form
    {
        public Schedule()
        {
            InitializeComponent();
        }

        private void Schedule_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'stafScheDataSet.Staff' table. You can move, or remove it, as needed.
            this.staffTableAdapter.Fill(this.stafScheDataSet.Staff);
            // TODO: This line of code loads data into the 'stafScheDataSet.Schedule' table. You can move, or remove it, as needed.
            this.scheduleTableAdapter.Fill(this.stafScheDataSet.Schedule);

        }

        private void dataGridView1_RowValidated(object sender, DataGridViewCellEventArgs e)
        {
            this.scheduleTableAdapter.Update(this.stafScheDataSet.Schedule);
        }

        private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            MessageBox.Show(e.Exception.Message);
        }

        private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 2)
            {
                if (string.IsNullOrEmpty(dataGridView1.CurrentCell.Value.ToString()))
                {
                    dataGridView1.CurrentCell.Value = DateTime.Now.ToString("yyyy-MM-dd HH:00:00");
                    //dataGridView1.CurrentCell.Style.Format = "yyyy-MM-dd HH:mm:ss";                        
                }
            }
        }

        private void Schedule_Activated(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(uc.User))
            {
                bindingNavigator1.Enabled = false;
                dataGridView1.ReadOnly = true;
            }
            else
            {
                bindingNavigator1.Enabled = true;
                dataGridView1.ReadOnly = false;
            }
        }
    }
